﻿using DevExpress.Mvvm;
using System.ComponentModel;
using System.Linq;

namespace DXApplication_TestDemo.Models.BindingModels
{
    public class MainModel : ViewModelBase
    {
        private int age;

        public int Age
        {
            get { return age; }
            set { age = value; RaisePropertyChanged(); }
        }

        private int age2;

        public int Age2
        {
            get { return age2; }
            set { age2 = value; RaisePropertyChanged(); }
        }

        //使用virtual可自动通知
        //public virtual int Age2 { get; set; }

        private BindingList<string> fruitColl;

        public BindingList<string> FruitColl
        {
            get { return fruitColl; }
            set { fruitColl = value; RaisePropertyChanged(); }
        }

        private string fruitSel;

        public string FruitSel
        {
            get { return fruitSel; }
            set { fruitSel = value; RaisePropertyChanged(); }
        }


        public MainModel()
        {
            Age = 1111;
            Age2 = 2222;
            FruitColl = new BindingList<string>() { "苹果", "菠萝", "香蕉", "葡萄", "哈密瓜", "水蜜桃" };
            FruitSel = FruitColl.First();


        }

    }
}
